package com.marketing.auth.controller;

import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;

/**
 * 简单的测试控制器
 * 用于测试网关路由功能
 *
 * @author Marketing System
 * @version 1.0
 */
@RestController
@RequestMapping("/auth")
public class SimpleTestController {

    /**
     * 健康检查接口
     */
    @GetMapping("/health")
    public Map<String, Object> health() {
        Map<String, Object> response = new HashMap<>();
        response.put("status", "UP");
        response.put("service", "auth-service");
        response.put("timestamp", System.currentTimeMillis());
        response.put("message", "认证服务运行正常");
        return response;
    }

    /**
     * 测试路由接口
     */
    @GetMapping("/test")
    public Map<String, Object> test() {
        Map<String, Object> response = new HashMap<>();
        response.put("success", true);
        response.put("service", "auth-service");
        response.put("message", "网关路由测试成功");
        response.put("timestamp", System.currentTimeMillis());
        return response;
    }

    /**
     * 登录测试接口
     */
    @PostMapping("/login")
    public Map<String, Object> login(@RequestBody Map<String, Object> request) {
        Map<String, Object> response = new HashMap<>();
        response.put("success", true);
        response.put("message", "登录功能正在开发中");
        response.put("service", "auth-service");
        response.put("requestData", request);
        response.put("timestamp", System.currentTimeMillis());
        return response;
    }
}